package com.bjbn.aesbcommonapi.controller;

import com.bjbn.aesbcommonapi.config.RocketMQConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/health")
@RequiredArgsConstructor
public class HealthController {
    private final RocketMQConfig rocketMQConfig;

    @GetMapping("/ping")
    public String ping() {
        return "OK";
    }

    @GetMapping("/topics")
    public List<RocketMQConfig.GroupConfig> topics() {
        return rocketMQConfig.getGroups();
    }
} 